module.exports = (grunt)->
  grunt.initConfig
    coffee:
      all:
        options:
          bare: true
        expand: true,
        cwd:  'Assets/coffeescript',
        src:  '**/*.coffee',
        dest:   'webroot/js',
        ext:  '.asset.js'
    watch:
      coffee:
        files: 'Assets/**/*.coffee',
        tasks: ['coffee', 'uglify']
      sass:
        files: 'Assets/**/*.scss',
        tasks: ['compass']

    uglify:
      all:
        files:[
          expand: true,
          cwd:  'webroot/js',
          src:  '*.asset.js',
          dest:   'webroot/js'
        ]
    compass:
      all:
        options:
          sassDir:    'Assets/sass',
          importPath:   'Assets/sass/import',
          cssDir:     'webroot/css',
          imagesDir:    'webroot/img',
          fontsPath:    'webroot/fonts',
          httpFontsPath:  '/fonts',
          httpImagesPath: '/img',
          environment:  'production'

  grunt.loadNpmTasks 'grunt-contrib-coffee'
  grunt.loadNpmTasks 'grunt-contrib-watch'
  grunt.loadNpmTasks 'grunt-contrib-uglify'
  grunt.loadNpmTasks 'grunt-contrib-compass'

  grunt.registerTask 'default', ['coffee', 'compass', 'uglify']